﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Notice.aspx.cs" Inherits="Notice" Title="通知" Culture="auto" UICulture="auto" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">
    <script type="text/javascript">
    function opencreatewindow(createtype)
    {
        if (window.showModalDialog)
        {      
            retVal = window.showModalDialog("createnotice.aspx?type=" + createtype ,'创建公告',"dialogHeight:500px;dialogWidth:860px;resizable:no;center:yes;");
        }
        else
        {
            retVal = window.open("createnotice.aspx?type=" + createtype ,'创建公告','height=480,width=860,resizable=yes,modal=yes');
        }  
        //window.location.href=window.location.pathname;
        window.location.reload();
    }
    </script>

    <h1 id="pagetitle" class="pagetitle">
        通知管理
        <asp:UpdateProgress ID="UpdateProgress1" runat="server">
            <ProgressTemplate>
                <div class="anistyle" id="ani">
                    正在加载数据，请耐心等待...
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
    </h1>
    <asp:UpdatePanel ID="UpdatePanel" runat="server">
        <ContentTemplate>
            <div class="condition">
                <div class="conditionbutton">
                <span id="span_create_all" runat="server">
                    <input type="submit" id="createall" onclick="javascript:opencreatewindow('all');"
                        value="创建公告" /></span>
                   <span id="span_create_one" runat="server"> <input type="submit" id="createone" onclick="javascript:opencreatewindow('one');"
                        value="创建定向消息" /></span>
                </div>
            </div>
            <div runat="server" id="divResult" class="divResult">
                <asp:Label ID="OperationResult" CssClass="result" runat="server" Text=""></asp:Label>
            </div>
            <div class="InfoArea">
                <div>
                    <asp:Panel ID="SummaryPanel" runat="server" Width="100%">
                        <asp:Repeater ID="Repeater" runat="server" OnItemCommand="Repeater_ItemCommand">
                            <HeaderTemplate>
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr style="height: 24px;">
                                    <td style="width: 120px;">
                                        <img src="images/bg_bullet_half_1.gif" alt="" />
                                        <span>
                                            <%#DataBinder.Eval(Container.DataItem, "Create_Time")%>
                                        </span>
                                    </td>
                                    <td style="width: 50px;">
                                        <%# DataBinder.Eval(Container.DataItem, "publish_type_name")%>
                                    </td>
                                    <td style="color: #757575;">
                                        <asp:LinkButton ID="btnDisplay" runat="server" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Notice_ID")%>'
                                            CommandName="detail" Text='<%# this.Substring(DataBinder.Eval(Container.DataItem, "Title").ToString()) %>'></asp:LinkButton>
                                    </td>
                                    <td align="right">
                                        <a onclick="javascript:opencreatewindow('edit&noticeid=<%#DataBinder.Eval(Container.DataItem, "Notice_ID")%>');return false;"
                                                href="#">[编辑信息]</a>
                                        <asp:LinkButton ID="GvDelete" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "Notice_ID")%>'
                                            CommandName="delete" OnClientClick="javascript:return confirm('您确定要删除此条记录吗？');">[删除信息]</asp:LinkButton>
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                </table>
                            </FooterTemplate>
                        </asp:Repeater>
                        <webdiyer:AspNetPager ID="AspNetPager" runat="server" ShowCustomInfoSection="Left"
                            CustomInfoHTML="总计篇数：%RecordCount%，总页数：%PageCount%，当前为第%CurrentPageIndex%篇" CustomInfoTextAlign="left"
                            CustomInfoStyle="padding-top:8px;font-weight:bold;" HorizontalAlign="right" FirstPageText="首篇"
                            LastPageText="最后" NextPageText="下一篇" OnPageChanged="AspNetPager_PageChanged"
                            PrevPageText="上一篇" ShowPageIndexBox="Always" SubmitButtonText="Go" TextAfterPageIndexBox="篇"
                            TextBeforePageIndexBox="转到" CssClass="anpager" CurrentPageButtonClass="cpb">
                        </webdiyer:AspNetPager>
                    </asp:Panel>
                    <asp:Panel ID="DetailPanel" runat="server" Width="100%" Visible="false">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: solid 1px #bababa;
                            margin-bottom: 4px;">
                            <tr style="height: 20px; background-color: #f7f7f7;">
                                <td style="width: 10%;">
                                    消息编号：</td>
                                <td style="width: 40%; color: Red; font-weight: bold;">
                                    <asp:Label runat="server" ID="labNotice_ID"></asp:Label>
                                </td>
                                <td style="width: 10%;">
                                    发布人：</td>
                                <td style="width: 40%;">
                                    <asp:Label runat="server" ID="labDisplay_Name"></asp:Label>
                                </td>
                            </tr>
                            <tr style="height: 20px; background-color: #f7f7f7;">
                                <td>
                                    消息类型：</td>
                                <td>
                                    <asp:Label runat="server" ID="labPublish_Type_Name"></asp:Label>
                                </td>
                                <td>
                                    发布时间：</td>
                                <td>
                                    <asp:Label runat="server" ID="labCreate_Time"></asp:Label>
                                </td>
                            </tr>
                            <tr style="height: 20px; background-color: #f7f7f7;">
                                <td>
                                    消息标题：</td>
                                <td colspan="3">
                                    <asp:Label runat="server" ID="labTitle"></asp:Label>
                                </td>
                            </tr>
                            <tr style="height: 20px; background-color: #f7f7f7;">
                                <td>
                                    消息内容：</td>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td align="right" style="padding-right: 4px; font-weight: bold;">
                                    <%--                                            <a onclick="javascript:opencreatewindow('edit&noticeid=<%#DataBinder.Eval(Container.DataItem, "Notice_ID")%>');return false;"
                                                href="#">[编辑信息]</a>
                                            <asp:LinkButton ID="GvDelete" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "Notice_ID")%>'
                                                CommandName="delete" OnClientClick="javascript:return confirm('您确定要删除此条记录吗？');">[删除信息]</asp:LinkButton>
--%>
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 1px; background-color: #F0f0f0;" colspan="4">
                                </td>
                            </tr>
                            <tr style="height: 20px;" valign="top">
                                <td height="300" colspan="4" style="font-weight: bold; color: black; padding-top: 4px;">
                                    <iframe runat="server" id="noticeframe" scrolling="yes" height="300px" frameborder="no"
                                        width="100%"></iframe>
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 1px; background-color: #F0f0f0;" colspan="4">
                                </td>
                            </tr>
                            <tr style="height: 20px;">
                                <td>
                                    附件：</td>
                                <td colspan="3" align="right">
                                    <%--href="uploadfiles.aspx?notice&id=<%#DataBinder.Eval(Container.DataItem, "Notice_ID")%>&m=0"--%>
                                    <asp:LinkButton runat="server" ID="btnAttachFile" OnClick="btnAttachFile_Click">
                                                添加附件</asp:LinkButton>
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 1px; background-color: #F0f0f0;" colspan="4">
                                </td>
                            </tr>
                            <tr style="height: 20px;">
                                <td colspan="4">
                                    <asp:Repeater ID="RepFile" runat="server" OnItemCommand="RepFile_ItemCommand">
                                        <ItemTemplate>
                                            <li><a href="getfile.aspx?fileid=<%#DataBinder.Eval(Container.DataItem, "File_ID")%>">
                                                <%#DataBinder.Eval(Container.DataItem, "File_Name")%>
                                            </a>
                                                <asp:LinkButton ID="btnDeleteFile" CommandName='<%#DataBinder.Eval(Container.DataItem, "File_ID")%>' Width="100px"
                                                            runat="server">删除</asp:LinkButton>
                                            </li>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </td>
                            </tr>
                            <tr style="height: 24px;">
                                <td colspan="4" align="right">
                                    <asp:Button ID="btnDetailReturn" runat="server" Text="返回" OnClick="btnDetailReturn_Click" /></td>
                            </tr>
                            <tr>
                                <td style="height: 1px; background-color: #F0f0f0;" colspan="4">
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
<%--                    <asp:Panel ID="EditPanel" runat="server" Visible="false" Width="100%">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 120px; height: 24px;">
                                    &nbsp;&nbsp;消息编号：</td>
                                <td style="width: 400px;">
                                    <asp:Label ID="labNoticeID" runat="server" Text=""></asp:Label>
                                </td>
                                <td style="width: 150px;">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 120px; height: 24px;">
                                    &nbsp;&nbsp;消息类型：</td>
                                <td style="width: 400px;">
                                    <asp:Label ID="labType" runat="server" Text=""></asp:Label>
                                </td>
                                <td style="width: 150px;">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                                </td>
                            </tr>
                            <asp:Panel ID="user" runat="server" Visible="false">
                                <tr>
                                    <td style="width: 120px; height: 24px;">
                                        &nbsp;&nbsp;选择用户：</td>
                                    <td colspan="2">
                                        <asp:CheckBoxList ID="CheckUsers" runat="server" DataTextField="Display_Name" DataValueField="UID"
                                            RepeatColumns="8" Width="100%" RepeatLayout="flow">
                                        </asp:CheckBoxList></td>
                                </tr>
                                <tr>
                                    <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                                    </td>
                                </tr>
                            </asp:Panel>
                            <tr>
                                <td style="height: 24px;">
                                    &nbsp;&nbsp;消息标题：</td>
                                <td style="width: 400px;" colspan="2">
                                    <asp:TextBox ID="CreateNotice_Title" runat="server" Width="99%"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 24px;">
                                    &nbsp;&nbsp;消息内容：</td>
                                <td colspan="2">
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3">
                                    <FCKeditorV2:FCKeditor ID="FCKeditorContent" runat="server" BasePath="fckeditor/"
                                        Width="100%" Height="320px">
                                    </FCKeditorV2:FCKeditor>
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 24px;">
                                    &nbsp;&nbsp;附件：</td>
                                <td colspan="2" align="right">
                                <asp:LinkButton runat="server" ID="btnAttachFile" OnClick="btnAttachFile_Click">
                                                添加附件</asp:LinkButton>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3">
                                    <asp:Repeater ID="RepFileEdit" runat="server" OnItemCommand="RepFile_ItemCommand">
                                        <ItemTemplate>
                                            <li><a href="getfile.aspx?fileid=<%#DataBinder.Eval(Container.DataItem, "File_ID")%>">
                                                <%#DataBinder.Eval(Container.DataItem, "File_Name")%>
                                            </a>
                                                <asp:LinkButton ID="btnDeleteFile" CommandName='<%#DataBinder.Eval(Container.DataItem, "File_ID")%>'
                                                    Width="100px" runat="server">删除</asp:LinkButton></li>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                                </td>
                            </tr>
                            <tr>
                                <td class="tblfooter" colspan="3" align="right">
                                    <asp:Button ID="EditSave" runat="server" Text="保存修改" Width="100px" OnClick="EditSave_Click"
                                        ValidationGroup="Create" />
                                </td>
                            </tr>
                            <tr>
                                <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
--%>                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
